package com.fenghongzhang.day005;

import android.app.Dialog;
import android.content.Context;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.ProgressBar;
import android.widget.Toast;

import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer;

/**
 * 基础播放器. 一定要重新布局.
 * 布局里面要有init 自己 的ui
 *
 * 双击
 * 长按
 *
 */
public class MyPlayer2 extends StandardGSYVideoPlayer {

    public MyPlayer2(Context context, Boolean fullFlag) {
        super(context, fullFlag);
    }

    public MyPlayer2(Context context) {
        super(context);
    }

    public MyPlayer2(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public int getLayoutId() {
        return R.layout.my_player_layout;
    }

    @Override
    protected void init(Context context) {
        super.init(context);
        ImageView button = findViewById(R.id.btn);
        button.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                Toast.makeText(context, "haha", Toast.LENGTH_SHORT).show();
            }
        });
        mStartButton.setVisibility(View.GONE);
    }

    @Override
    protected void touchDoubleUp(MotionEvent e) {
//        super.touchDoubleUp(e);
        //dianzan
    }


    @Override
    protected void touchLongPress(MotionEvent e) {
//        super.touchLongPress(e);
        Toast.makeText(mContext, "长按", Toast.LENGTH_SHORT).show();
    }

    @Override
    protected void showVolumeDialog(float deltaY, int volumePercent) {

    }
}
